﻿namespace WMS6.Web.Inventory
{
    using System;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;

    public class MovementQuery : BasePage
    {
        protected Button btnExport;
        protected Button btnList;
        protected Button btnSearch;
        protected DropDownList ddlExternalLotOper;
        protected DropDownList ddlLocOper;
        protected DropDownList ddlLotOper;
        protected DropDownList ddlLpnOper;
        protected DropDownList ddlOwnerIDOper;
        protected DropDownList ddlSkuDescrOper;
        protected DropDownList ddlSkuIDOper;
        protected DropDownList ddlVendorIDOper;
        protected HtmlForm F5210;
        protected HtmlInputHidden hdnActionID;
        protected Label lblExternalLot;
        protected Label lblLoc;
        protected Label lblLot;
        protected Label lblLpn;
        protected Label lblMovement;
        protected Label lblOwnerID;
        protected Label lblSkuDescr;
        protected Label lblSkuID;
        protected Label lblVendorID;
        protected HtmlLink mycss;
        protected ScriptManager ScriptManager1;
        protected TextBox txtExternalLot;
        protected TextBox txtLoc;
        protected TextBox txtLot;
        protected TextBox txtLPN;
        protected TextBox txtOwnerID;
        protected TextBox txtSkuDescr;
        protected TextBox txtSkuID;
        protected TextBox txtVendorID;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("MovementList.aspx", false);
        }

        private void InitDropDownLists()
        {
            base.InitQueryDDL(this.ddlOwnerIDOper, 0);
            base.InitQueryDDL(this.ddlSkuIDOper, 0);
            base.InitQueryDDL(this.ddlLocOper, 0);
            base.InitQueryDDL(this.ddlLotOper, 0);
            base.InitQueryDDL(this.ddlLpnOper, 0);
            base.InitQueryDDL(this.ddlSkuDescrOper, 0);
            base.InitQueryDDL(this.ddlExternalLotOper, 0);
            base.InitQueryDDL(this.ddlVendorIDOper, 0);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.InitDropDownLists();
            }
        }

        public string ExternalLot
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtExternalLot.Text.Trim()))
                {
                    return base.GetParamsString(this.txtExternalLot.Text.Trim(), this.ddlExternalLotOper.SelectedValue);
                }
                return "";
            }
        }

        public string Loc
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLoc.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLoc.Text.Trim(), this.ddlLocOper.SelectedValue);
                }
                return "";
            }
        }

        public string Lot
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLot.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLot.Text.Trim(), this.ddlLotOper.SelectedValue);
                }
                return "";
            }
        }

        public string Lpn
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLPN.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLPN.Text.Trim(), this.ddlLpnOper.SelectedValue);
                }
                return "";
            }
        }

        public string OwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerID.Text.Trim(), this.ddlOwnerIDOper.SelectedValue);
                }
                return "";
            }
        }

        public string SkuDescr
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSkuDescr.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSkuDescr.Text.Trim(), this.ddlSkuDescrOper.SelectedValue);
                }
                return "";
            }
        }

        public string SkuID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSkuID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSkuID.Text.Trim(), this.ddlSkuIDOper.SelectedValue);
                }
                return "";
            }
        }

        public string VendorID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtVendorID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtVendorID.Text.Trim(), this.ddlVendorIDOper.SelectedValue);
                }
                return "";
            }
        }
    }
}

